from rest_framework.exceptions import APIException


class ServiceUnavilable(APIException):
    """后端服务不可达"""
    status_code = 503
    default_detail = "系统繁忙，请稍后再试"
    default_code = 'service_unavaliable'


class ParmError(APIException):
    """参数错误"""
    status_code = 400
    default_detail = "参数错误"
    default_code = 'parm_error'


class InnerError(APIException):
    """内部错误"""
    status_code = 501
    default_detail = "系统错误"
    default_code = 'server_error'

"""自制api的错误消息"""
exception_detail = {
    'NotAuthenticated': '没有提供Token'
}